﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace MiniFox.Infrastructure
{
    /// <summary>
    /// 
    /// </summary>
    public class ErrorResponse : Response
    {
        Exception _exception;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="exception"></param>
        public ErrorResponse(Exception exception)
        {
            Exceptions.SystemException e;
            if (exception is Exceptions.SystemException)
            {
                e = exception as Exceptions.SystemException;
            }
            else
            {
                e = new Exceptions.SystemException(exception);
            }
            _exception = e;
            Code = e.ErrorCode;
            Message = _exception.Message;
        }
    }
}
